const app = getApp();
var WxParse = require('../../untils/wxParse/wxParse.js')
Page({
  data: {
    mainInfo:{},
    createTime:'',
  },
  onLoad: function (opt) {
    wx.setNavigationBarTitle({
      title: '信息公告详情',
    });
    this.initPage(opt)
  },
  initPage: function (opt) {
    var _this = this;
    app.doReq(app.globalData.SERVICE.INDEX.MSGDETAIL, {
      "id": opt.newsid
    }, 'GET', function (res) {
      var article = res.data.obj.content;
      WxParse.wxParse('article', 'html', article, _this);
      console.log(res);
      _this.setData({
        mainInfo: res.data.obj,
        createTime:res.data.obj.createTime.substring(0, 10)
      })
    });
  },
})